#include <stdio.h>
#include "CCEMan.h"

void TestFrame1()
{
	int m, i, j, k;
	unsigned char buf0[] = {0x68, 0x07, 0x31, 0x00, 0x10, 0x40, 0x0B, 0x68, 0x89, 0x4F, 0x00, 0x01, 0x01, 0x04, 0x08, 0x29, 0x23, 0x48, 0x4B, 0x01, 0x48, 
		0x94, 0x15, 0x00, 0x62, 0x88, 0x03, 0xe6, 0x38, 0x81, 0x03, 0x00, 0x47, 0x92, 0x03, 0x00, 0x01, 0x32, 0x04, 0x00, 0x11, 0x00, 
		0x12, 0x23, 0x34, 0x00, 0x00, 0x45, 0x00, 0x56, 0x00, 0x78, 0x00, 0x89, 0x00, 0x98, 0x00, 0x87, 0xbb, 0xee, 0x24, 0x46, 0x05, 
		0x22, 0x00, 0x77, 0x00, 0x76, 0x00, 0x66, 0x00, 0x65, 0x00, 0x55, 0xe3, 0x00, 0x88, 0x88, 0x01, 0x00, 0x00, 0x88, 0x48, 0x22, 
		0x09, 0x08, 0xac, 0x1e, 0x54, 0x2a, 0xD1, 0x4F, 0x00, 0x01, 0x01, 0x04, 0x08, 0x29, 0x23, 0x48, 0x4B, 0x01, 0x48, 
		0x94, 0x15, 0x00, 0x62, 0x88, 0x03, 0xe6, 0x38, 0x81, 0x03, 0x00, 0x47, 0x92, 0x03, 0x00, 0x01, 0x32, 0x04, 0x00, 0x11, 0x00, 
		0x09, 0x08, 0xac, 0x1e, 0x54, 0x2a, 0xD1, 0x16};

	printf("[ Orig Buf ]: \t\t\t[ Length ] = %d\n", sizeof(buf0));
	for(m = 0; m < sizeof(buf0); m++)
	{
		printf("%02x ", buf0[m]);
	}

        /****************  Compress with EnData  ****************/
	i = EnData(buf0, sizeof(buf0), EXE_COMPRESS_NEW);
	printf("\n\n[ After EnData, Buf ]: \t\t[ Length ] = %d\n", i);
	for(j = 0; j < i; j++)
	{
		printf("%02x ", SendBuf[j]);
	}
        
	/****************  DeCompress with DeData  ****************/
	k = DeData(SendBuf, i);
	printf("\n\n[ After DeData, Buf ]: \t\t[ Length ] = %d\n", k);
	for(j = 0; j < k; j++)
	{
		printf("%02x ", RecvBuf[j]);
		if (RecvBuf[j] != buf0[j])
		{
			printf("the No%d char is wrong!!!!!!!!\n", j);
		}
	}
	printf("\n\n");

}

